function timeMove = readTimeUntilMovement(data,fs);

% Do difference
ddata = diff(data);

% do pythaogras
ddata = ddata.^2;
ddata = ddata(:,1) + ddata(:,2);
ddata = ddata.^0.5;

% Do threshold
ddata = cumsum(ddata);
i = find(ddata > 0.05,1,'first');
timeMove = i/fs;
if isempty(timeMove)
    timeMove = NaN;
end
